/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Gautch
 */
@Entity
@Table(name = "redacteur")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Redacteur.findAll", query = "SELECT r FROM Redacteur r"),
    @NamedQuery(name = "Redacteur.findByIdredac", query = "SELECT r FROM Redacteur r WHERE r.idredac = :idredac"),
    @NamedQuery(name = "Redacteur.findByMdpredac", query = "SELECT r FROM Redacteur r WHERE r.mdpredac = :mdpredac")})
public class Redacteur implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "idredac")
    private String idredac;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "mdpredac")
    private String mdpredac;

    public Redacteur() {
    }

    public Redacteur(String idredac) {
        this.idredac = idredac;
    }

    public Redacteur(String idredac, String mdpredac) {
        this.idredac = idredac;
        this.mdpredac = mdpredac;
    }

    public String getIdredac() {
        return idredac;
    }

    public void setIdredac(String idredac) {
        this.idredac = idredac;
    }

    public String getMdpredac() {
        return mdpredac;
    }

    public void setMdpredac(String mdpredac) {
        this.mdpredac = mdpredac;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idredac != null ? idredac.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Redacteur)) {
            return false;
        }
        Redacteur other = (Redacteur) object;
        if ((this.idredac == null && other.idredac != null) || (this.idredac != null && !this.idredac.equals(other.idredac))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.Redacteur[ idredac=" + idredac + " ]";
    }
    
}
